package aoj.no_0500;

import java.util.Scanner;

public class No_0502 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int nCommand = sc.nextInt();
			if(nCommand == 0)
				break;
			
			int count = 0;
			int top = 1;
			int front = 2;
			int side = 3;
			
			int ans = 1;
			while(count < nCommand) {
				String cmd = sc.next();
				if(cmd.equals("North")) {
					int tmp = top;
					top = front;
					front = 7 - tmp;
				}
				else if(cmd.equals("East")) {
					int tmp = top;
					top = 7 - side;
					side = tmp;
				}
				else if(cmd.equals("West")) {
					int tmp = top;
					top = side;
					side = 7 - tmp;
				}
				else if(cmd.equals("South")) {
					int tmp = top;
					top = 7 - front;
					front = tmp;
				}
				else if(cmd.equals("Right")) {
					int tmp = front;
					front = side;
					side = 7 - tmp;
				}
				else if(cmd.equals("Left")) {
					int tmp = side;
					side = front;
					front = 7 - tmp;
				}
				ans += top;
				count++;
			}
			System.out.println(ans);
		}
	}
}
/*
5
North
North
East
South
West
8
West
North
Left
South
Right
North
Left
East
0 
*/
